{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "wRfG0B6jxcT0"
      },
      "source": [
        "# Tutorial: Installation\n",
        "\n",
        "In this series of tutorials, we will try to install and run ReacNetGenerator.\n",
        "\n",
        "In this tutorial, we will use `pip` to install ReacNetGenerator. This is the eastiest way without compiling the package."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "sfF2fuVHyu2M"
      },
      "source": [
        "## Install ReacNetGenerator\n",
        "We use `pip` to install the ReacNetGenerator. It's very simple as follows!"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "c5oBZFSQtKFi",
        "outputId": "8d63a695-7630-499a-b4ff-d598bf86248a"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Collecting reacnetgenerator\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/1f/e9/56819faadf4d9c253b4110fb0e1304a2a80094e03c4e9e9a8a67fb6c1751/reacnetgenerator-1.4.164-cp37-cp37m-manylinux2010_x86_64.whl (4.3MB)\n",
            "\u001b[K     |████████████████████████████████| 4.3MB 6.3MB/s \n",
            "\u001b[?25hCollecting lz4\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/e3/52/151c815a486290608e4dc6699a0cfd74141dc5191f8fe928e7d1b28b569e/lz4-3.1.3-cp37-cp37m-manylinux2010_x86_64.whl (1.8MB)\n",
            "\u001b[K     |████████████████████████████████| 1.8MB 37.9MB/s \n",
            "\u001b[?25hCollecting coloredlogs\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/84/a6/837dbf6eac344cb74f0ba86b79e8180855570af3e26bcb1ea5f650cf944c/coloredlogs-15.0-py2.py3-none-any.whl (45kB)\n",
            "\u001b[K     |████████████████████████████████| 51kB 4.6MB/s \n",
            "\u001b[?25hCollecting scour\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/75/19/f519ef8aa2f379935a44212c5744e2b3a46173bf04e0110fb7f4af4028c9/scour-0.38.2.tar.gz (52kB)\n",
            "\u001b[K     |████████████████████████████████| 61kB 5.7MB/s \n",
            "\u001b[?25hRequirement already satisfied: networkx in /usr/local/lib/python3.7/dist-packages (from reacnetgenerator) (2.5)\n",
            "Collecting ase\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/a5/36/de17e79f29e06d9a92746d0dd9ec4636487ab03f6af10e78586aae533f7a/ase-3.21.1-py3-none-any.whl (2.2MB)\n",
            "\u001b[K     |████████████████████████████████| 2.2MB 33.9MB/s \n",
            "\u001b[?25hRequirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from reacnetgenerator) (2.23.0)\n",
            "Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from reacnetgenerator) (3.2.2)\n",
            "Collecting openbabel-wheel\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/f3/e8/74018a601ec40dd76b9ba6d0ddfa22a67bb5802fd6ffa46a344915d46ff4/openbabel_wheel-3.1.1.5-cp37-cp37m-manylinux2014_x86_64.whl (13.6MB)\n",
            "\u001b[K     |████████████████████████████████| 13.6MB 258kB/s \n",
            "\u001b[?25hRequirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from reacnetgenerator) (1.19.5)\n",
            "Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from reacnetgenerator) (1.1.5)\n",
            "Collecting pybase64\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/71/9c/fc5a2734645f9cdc7c0a549a4ee063cf25c05e728d287508fd14c437ac4e/pybase64-1.1.4-cp37-cp37m-manylinux2014_x86_64.whl (170kB)\n",
            "\u001b[K     |████████████████████████████████| 174kB 50.0MB/s \n",
            "\u001b[?25hRequirement already satisfied: scipy>=0.20.1 in /usr/local/lib/python3.7/dist-packages (from reacnetgenerator) (1.4.1)\n",
            "Collecting rdkit-pypi\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/6f/1b/053bddf14b39000ff95c59d012934fcbe96fef681ece0f8315c126c0bb5b/rdkit_pypi-2021.3.1.2-cp37-cp37m-manylinux2014_x86_64.whl (31.4MB)\n",
            "\u001b[K     |████████████████████████████████| 31.4MB 111kB/s \n",
            "\u001b[?25hCollecting hmmlearn>=0.2.1\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/4b/98/a2829aeb942b7146034d497afb3fc738a78a4fbd4797a039c19a94bb31f7/hmmlearn-0.2.5-cp37-cp37m-manylinux1_x86_64.whl (369kB)\n",
            "\u001b[K     |████████████████████████████████| 378kB 34.7MB/s \n",
            "\u001b[?25hRequirement already satisfied: tqdm in /usr/local/lib/python3.7/dist-packages (from reacnetgenerator) (4.41.1)\n",
            "Collecting humanfriendly>=9.1\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/93/66/363d01a81da2108a5cf446daf619779f06d49a0c4426dd02b40734f10e2f/humanfriendly-9.1-py2.py3-none-any.whl (86kB)\n",
            "\u001b[K     |████████████████████████████████| 92kB 7.4MB/s \n",
            "\u001b[?25hRequirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.7/dist-packages (from scour->reacnetgenerator) (1.15.0)\n",
            "Requirement already satisfied: decorator>=4.3.0 in /usr/local/lib/python3.7/dist-packages (from networkx->reacnetgenerator) (4.4.2)\n",
            "Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->reacnetgenerator) (3.0.4)\n",
            "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->reacnetgenerator) (1.24.3)\n",
            "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->reacnetgenerator) (2020.12.5)\n",
            "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->reacnetgenerator) (2.10)\n",
            "Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->reacnetgenerator) (2.8.1)\n",
            "Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->reacnetgenerator) (2.4.7)\n",
            "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->reacnetgenerator) (1.3.1)\n",
            "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib->reacnetgenerator) (0.10.0)\n",
            "Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.7/dist-packages (from pandas->reacnetgenerator) (2018.9)\n",
            "Requirement already satisfied: scikit-learn>=0.16 in /usr/local/lib/python3.7/dist-packages (from hmmlearn>=0.2.1->reacnetgenerator) (0.22.2.post1)\n",
            "Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn>=0.16->hmmlearn>=0.2.1->reacnetgenerator) (1.0.1)\n",
            "Building wheels for collected packages: scour\n",
            "  Building wheel for scour (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "  Created wheel for scour: filename=scour-0.38.2-cp37-none-any.whl size=54253 sha256=5c236125ed4b03b44f5f87c711b62d82acf7d183e110bee4250ae7cfbd78aa33\n",
            "  Stored in directory: /root/.cache/pip/wheels/0e/85/c0/989d78aef861a7859c2ec1e56157abc1255498e49dcbfa23f4\n",
            "Successfully built scour\n",
            "Installing collected packages: lz4, humanfriendly, coloredlogs, scour, ase, openbabel-wheel, pybase64, rdkit-pypi, hmmlearn, reacnetgenerator\n",
            "Successfully installed ase-3.21.1 coloredlogs-15.0 hmmlearn-0.2.5 humanfriendly-9.1 lz4-3.1.3 openbabel-wheel-3.1.1.5 pybase64-1.1.4 rdkit-pypi-2021.3.1.2 reacnetgenerator-1.4.164 scour-0.38.2\n"
          ]
        }
      ],
      "source": [
        "%%bash\n",
        "pip install reacnetgenerator"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Z-8L5vVKy9tc"
      },
      "source": [
        "Now, ReacNetGenerator has been already installed in the environment. Try it now!"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 2,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "ceO8qwJtxGxo",
        "outputId": "35312703-c874-4f25-d685-8592b577a3d2"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "usage: reacnetgenerator [-h] -i [INPUTFILENAME [INPUTFILENAME ...]] -a\n",
            "                        [ATOMNAME [ATOMNAME ...]] [--nohmm] [--dump]\n",
            "                        [--type TYPE] [--nopbc] [--cell CELL CELL CELL]\n",
            "                        [-n NPROC] [-s [SELECTATOMS [SELECTATOMS ...]]]\n",
            "                        [--stepinterval STEPINTERVAL] [--split SPLIT]\n",
            "                        [--maxspecies MAXSPECIES]\n",
            "                        [--matrixa MATRIXA MATRIXA MATRIXA MATRIXA]\n",
            "                        [--matrixb MATRIXB MATRIXB MATRIXB MATRIXB]\n",
            "                        [--urls URLS URLS]\n",
            "\n",
            "ReacNetGenerator 1.4.164\n",
            "\n",
            "optional arguments:\n",
            "  -h, --help            show this help message and exit\n",
            "  -i [INPUTFILENAME [INPUTFILENAME ...]], --inputfilename [INPUTFILENAME [INPUTFILENAME ...]]\n",
            "                        Input trajectory file, e.g. bonds.reaxc\n",
            "  -a [ATOMNAME [ATOMNAME ...]], --atomname [ATOMNAME [ATOMNAME ...]]\n",
            "                        Atomic names in the trajectory, e.g. C H O\n",
            "  --nohmm               Process trajectory without Hidden Markov Model (HMM)\n",
            "  --dump                Process the LAMMPS dump file\n",
            "  --type TYPE, -t TYPE  Input file type\n",
            "  --nopbc               Disable PBC.\n",
            "  --cell CELL CELL CELL, -c CELL CELL CELL\n",
            "                        Cell\n",
            "  -n NPROC, -np NPROC, --nproc NPROC\n",
            "                        Number of processes\n",
            "  -s [SELECTATOMS [SELECTATOMS ...]], --selectatoms [SELECTATOMS [SELECTATOMS ...]]\n",
            "                        Select atoms in the reaction network, e.g. C\n",
            "  --stepinterval STEPINTERVAL\n",
            "                        Step interval\n",
            "  --split SPLIT         Split number for the time axis\n",
            "  --maxspecies MAXSPECIES\n",
            "                        Max number of nodes (species) in the network\n",
            "  --matrixa MATRIXA MATRIXA MATRIXA MATRIXA\n",
            "                        Matrix A of HMM parameters\n",
            "  --matrixb MATRIXB MATRIXB MATRIXB MATRIXB\n",
            "                        Matrix B of HMM parameters\n",
            "  --urls URLS URLS      Download files\n"
          ]
        }
      ],
      "source": [
        "%%bash\n",
        "reacnetgenerator -h"
      ]
    }
  ],
  "metadata": {
    "colab": {
      "authorship_tag": "ABX9TyO+cxekv9t83GNtp5C+grJf",
      "include_colab_link": true,
      "name": "install.ipynb",
      "provenance": []
    },
    "kernelspec": {
      "display_name": "Python 3.10.6 64-bit",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "version": "3.10.6"
    },
    "vscode": {
      "interpreter": {
        "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1"
      }
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}
